package cool.taomu.toolkit.jesery

import cool.taomu.toolkit.Context
import cool.taomu.toolkit.TaomuConfigure
import cool.taomu.toolkit.TaomuGuice
import cool.taomu.toolkit.TaomuGuiceServiceLoader
import cool.taomu.toolkit.jersey.JerseyInternalInvoker
import cool.taomu.toolkit.jersey.RequestDto
import org.slf4j.LoggerFactory

class ApplictionTest {
	val static LOG = LoggerFactory.getLogger(ApplictionTest);

	def static main(String[] args) {
		entry();
	}

	def static void entry() {
		val TaomuConfigure config = new TaomuConfigure().loadConfig
		val injector = TaomuGuice.createInjector(config)
		TaomuGuiceServiceLoader.loadIPlatform(injector, config);
		var cinjector = injector.getInstance(Context);
		var invoker = cinjector.injectorSupplier.get.getInstance(JerseyInternalInvoker)
		var dto = new RequestDto();
		dto.serviceName = "/kademlia/index"
		dto.method = "get"
		println(invoker.invoke(dto));
	}
}
